package com.viknix.threadpool.manager.http;

import com.viknix.threadpool.manager.server.dependence.result.RestResult;

/**
 * @Author: Dongqi
 * @Date: 2021/11/22 10:57
 * @Version 1.0
 * @Description: Http callback.
 */
public interface Callback<T> {

    /**
     * Callback after the request is responded.
     *
     * @param result {@link RestResult}
     */
    void onReceive(RestResult<T> result);

    /**
     * An error occurred during the request.
     *
     * @param throwable {@link Throwable}
     */
    void onError(Throwable throwable);

    /**
     * Callback when the request is cancelled.
     */
    void onCancel();

}
